<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nick的小站-项目</title>
    <link rel="stylesheet" type="text/css" href="./css/links.css">
</head>

<body>


    <h1 class="title">项目</h1>

    <div class="items" id="items">

    </div>

    <script src="js/projects_data.js"></script>
    <script>
        var linkTemplate = '<div class="item"><a href="web_url" target="_blank"><span>web_name</span></a></div>';
        var itemsElement = document.getElementById("items");

        document.body.onload = function () {

            for (var i in project_list) {
                var o = project_list[i];
                var tempBox = linkTemplate.slice(0, linkTemplate.length);
                tempBox = tempBox.replace("web_url", o["url"]);
                tempBox = tempBox.replace("web_name", o["title"]);

                itemsElement.innerHTML += tempBox;
            }

        }

    </script>

</body>

</html>